#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int Maxn=1e5+6;
int n,p[Maxn],id[Maxn];

#define fi first
#define se second
#define mk make_pair
#define pii pair<int,int> 
vector<pii >ans;

int main(){
	freopen("rotate.in","r",stdin);
	freopen("rotate.out","w",stdout); 

	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&p[i]);
	
	int x=2;
	for(int i=1;i<=n;i++)
		for(int j=1;j<n;j++){
			if(p[j]>p[j+1]) ans.emplace_back(1,j),swap(p[j],p[j+1]);
		}
	printf("%d %d\n",x,(int)ans.size());
	for(auto i:ans) printf("1 %d\n",i);
	
	return 0;
}

